-
-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iOS] Picker not displayed when not on main view controller #136
Conversation
Retrieve the top view controller from the view hierarchy and display picker
Thanks for reporting that! |
Unfortunately, LocalUIViewController.current requires a @composable context and the onLaunch callback of FilePickerLauncher doesn't have this context. |
Yes that's ok, it can be created on Compose: |
That works! Do you want me to upload the changes? |
Yes |
[iOS] Use LocalUIViewController.current to show the picker
It need to be added as a key to the remember as well: ...
return remember(currentUiViewController) {
FilePickerLauncher(
... |
Miss import
Also, you forgot to push the import for |
yes, i fix it. sorry |
pass the currentUIViewController on remember
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look good. Thanks for your contribution!
Retrieve the top view controller from the view hierarchy and display picker.
In the current versión i get this error:
Attempt to present <UIDocumentPickerViewController: 0x10c80ac00> on <.MainViewController: 0x10a0099f0> (from <.MainViewController: 0x10a0099f0>) whose view is not in the window hierarchy.